<?php
Yii::app()->clientScript->registerScript('search', "
$('.search-button').click(function(){
	$('.search-form').toggle();
	return false;
});
$('.search-form form').submit(function(){
	$.fn.yiiGridView.update('article-grid', {
		data: $(this).serialize()
	});
	return false;
});
");
?>

<?php echo CHtml::link('高级搜索','#',array('class'=>'search-button')); ?>
<div class="search-form" style="display:none">
<?php $this->renderPartial('_search',array(
	'model'=>$model,
)); ?>
</div><!-- search-form -->

<?php $this->widget('zii.widgets.grid.CGridView', array(
	'id'=>'article-grid',
    'pager'=>array(
        'header'=>''),
	'dataProvider'=>$model->search(),
	'columns'=>array(
		'Title',
		array('name'=>'Content','value'=>'substr($data->Content,0,6)."……"'),
		'UpdateTime',
		'KeyWord',
		array('name'=>'Status','value'=>'($data->Status==1)?"正常":($data->Status==2?"未通过":"审核中")'),
		array(
            'header'=>'操作',
			'class'=>'CButtonColumn',
            'headerHtmlOptions' => array('width'=>'90'),
            'htmlOptions' => array('align'=>'center'),
            'template'=>'{preview} {view}{update}{delete}',
            'buttons'=>array(
                'preview' => array(
                    'label'=>'查看详情',
                    'options'=>array('target'=>'_blank',), 
                    'imageUrl'=>'images/icon/preview.png',
                    'url'=>'$data->Path',
                ),
            
		),
        ),
	),
)); ?>
<?php
//谈对话框
$this->beginWidget('zii.widgets.jui.CJuiDialog', array(
  'id'=>'mydialog',
  // additional javascript options for the dialog plugin
  'options'=>array(
    'title'=>'系统提示',
    'autoOpen'=>false,
    'modal'=>true,
  ),
));
    //输出弹出框的内容
    //echo $this->renderPartial('_form',null,true);
 echo 'dialog content here';

echo CHtml::button('open dialog', array(
   'onclick'=>'$("#mydialog").dialog("open"); return false;',
));





$this->endWidget('zii.widget.jui.CJuiDialog');
 
//打开对话框的链接
echo CHtml::link('登录', '#', array(
 'onclick'=>'$("#mydialog").dialog("open"); return false;',
));
?>
